package cn.school.config;

import cn.school.job.SchoolPlatformJob;
import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;

@Configurable
public class QuartzConfig {

    @Bean("SchoolPlatformJob")
    public JobDetail iotPlatformJobJobDetail() {
        return JobBuilder.newJob(SchoolPlatformJob.class)
                .withIdentity("DateTimeJob")
                .usingJobData("msg", "Hello Quartz")
                .storeDurably()//即使没有Trigger关联时，也不需要删除该JobDetail
                .build();
    }
}
